package com.example.lvsuo.service.impl;

import com.example.lvsuo.entity.vo.CaseDecreaseVo;
import com.example.lvsuo.service.ICaseDecreaseService;
import com.example.lvsuo.entity.CaseDecrease;
import com.example.lvsuo.mapper.CaseDecreaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 费用减免 服务实现类
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@Service
@Transactional
public class CaseDecreaseServiceImpl extends ServiceImpl<CaseDecreaseMapper, CaseDecrease> implements ICaseDecreaseService {

    @Autowired
    CaseDecreaseMapper cm;

    @Override
    public PageInfo queryCaseDecrease(CaseDecreaseVo c) {
        if(c.getPageNum()==null){
            c.setPageNum(1);
        }
        if(c.getPageSize()==null){
            c.setPageSize(5);
        }
        PageHelper.startPage(c.getPageNum(),c.getPageSize());
        return new PageInfo(cm.queryCaseDecrease(c));
    }
    @Override
    public List<CaseDecrease> getCaseLawid(CaseDecrease c) {
        return this.baseMapper.getCaseLawid(c);
    }
}
